<template>
  <div class="dashboard-editor-container">
    <el-tabs type="border-card" @tab-click="handleTabClick" v-model="activeTab" >
        <el-tab-pane label="资产信息" name="tab1">
          <assetsInfo :Moder="Moder"></assetsInfo> 
        </el-tab-pane>
        <el-tab-pane label="硬件详情">
          <HardDetail :DeviceObj = deviceForm></HardDetail>
        </el-tab-pane>
         <el-tab-pane label="今日事件">
          <div class="top">
                <el-button type="primary" style="float:right;margin-bottom: 10px;" @click="$router.go(-1)">返回</el-button>
          </div>
          <el-table stripe border :data="eventTable" style="width: 100%; margin-top: 15px;min-height:520px">
          <el-table-column label="序号"  width="60" type="index" :index='(index)=>{return (index + 1) + (this.EventpageNum- 1)*this.EventpageSize}'> </el-table-column>
          <!-- <el-table-column label="所在分区" show-overflow-tooltip prop="PrimArea" width="150" align="left">
              <template slot-scope="{row}">
                <span>{{ row.PrimArea }} / {{ row.SecondArea }}</span>
              </template>
            </el-table-column>
          <el-table-column label="所在校区" show-overflow-tooltip prop="SchoolName" align="left">
            <template slot-scope="{row}">
              <span>{{ row.SchoolName }}</span>
            </template>
          </el-table-column> -->
          <el-table-column label="资产名称" width="140" show-overflow-tooltip prop="DeviceName" align="left">
            <template slot-scope="{row}">
              <span>{{ row.DeviceName }}</span>
            </template>
          </el-table-column>
          <el-table-column label="发生时间" show-overflow-tooltip prop="TransTime" width="160px" align="left"></el-table-column>
          <el-table-column label="事件类型" width="140" show-overflow-tooltip prop="EventID" align="left">
            <template slot-scope="{row}">
              {{ getEventLabel(row.EventID) }}
            </template>
          </el-table-column>
          <el-table-column label="发生事件源" show-overflow-tooltip prop="EventType" width="100" align="left">
            <template slot-scope="{row}">
              <span v-show="row.EventType == '1'">管理中心</span>
              <span v-show="row.EventType == '2'">校区装置</span>
              <span v-show="row.EventType == '3'">终端资产</span>
            </template>
          </el-table-column>
          <el-table-column label="严重性等级" show-overflow-tooltip prop="EventLevel" width="100" align="left">
            <template slot-scope="{row}">
              <span style="color:#F56C6C" v-show="row.EventLevel == '1'">紧急</span>
              <span style="color:#E6A23C" v-show="row.EventLevel == '2'">重要</span>
              <span style="color:#909399" v-show="row.EventLevel == '3'">默认</span>
              <span style="color:#409EFF" v-show="row.EventLevel == '4'">普通</span>
              <span style="color:#67C23A" v-show="row.EventLevel == '5'">告知</span>
            </template>
          </el-table-column>
          <el-table-column label="描述信息" show-overflow-tooltip prop="Descp" align="left"></el-table-column>
          <el-table-column label="确认状态" show-overflow-tooltip prop="IsAck" width="100" align="left">
            <template slot-scope="{row}">
              <span style="color:#909399" v-show="row.IsACK == '0'">未确认</span>
              <span style="color:#67C23A" v-show="row.IsACK == '1'">已确认</span>
            </template>
          </el-table-column>
          <el-table-column label="操作" align="left" width="120px" fixed="right">
                <template slot="header" slot-scope="scope">
                  <el-button size="mini"  :type="!control?'info':'primary'" :disabled="!control" @click="changeMailGlobalAll(scope.row)">确认本页</el-button>
                </template> 
                <template slot-scope="scope">
                <el-button size="mini" :type="scope.row.IsACK?'info':'primary'" :disabled="scope.row.IsACK != 0" @click="changeMailGlobal(scope.row)">确  认</el-button>
                </template>
            </el-table-column>
        </el-table>
        <el-pagination 
          @size-change="handleSizeChangeEvent"
          @current-change="handleCurrentChangeEvent" 
          :current-page=EventpageNum
          :page-size=EventpageSize
          background 
          layout="total, prev, pager, sizes, next, jumper"
          :total="EventTotal">
        </el-pagination>
         </el-tab-pane>
         <el-tab-pane label="CPU监测" lazy> 
          <div class="top">
            <el-button type="primary" style="position: absolute; right: 15px; top: 15px;" @click="$router.go(-1)">返回</el-button>
          </div>
          <div style="margin-top:30px;">
              <linechart :chartData="lineData_cpu"></linechart>
          </div>
        </el-tab-pane> 
        <el-tab-pane label="内存监测" lazy> 
          <div class="top">
            <el-button type="primary" style="position: absolute; right: 15px; top: 15px;" @click="$router.go(-1)">返回</el-button>
          </div>
          <div style="margin-top:30px;">
              <linechart :chartData="lineData_soft" ></linechart>
          </div>
        </el-tab-pane>
        <el-tab-pane label="网络业务">
          <div class="top">
                <el-button type="primary" style="float:right;margin-bottom: 10px;" @click="$router.go(-1)">返回</el-button>
          </div>
           <el-table stripe border :data="netForm" style="width: 100%; margin-top: 15px;min-height:520px">
          <el-table-column label="序号"  width="60" type="index" :index='(index)=>{return (index + 1) + (this.pageNum_net - 1)*this.pageSize_net}'> </el-table-column>
          <!-- <el-table-column label="所在分区" prop="PrimArea" width="150" align="left" show-overflow-tooltip>
              <template slot-scope="{row}">
                <span>{{ row.PrimArea }} / {{ row.SecondArea }}</span>
              </template>
            </el-table-column>
            <el-table-column label="所在校区" show-overflow-tooltip prop="SchoolName" align="left">
            <template slot-scope="{row}">
              <span>{{ row.SchoolName }}</span>
            </template>
          </el-table-column> -->
          <el-table-column label="资产名称" show-overflow-tooltip prop="DeviceName" align="left">
            <template slot-scope="{row}">
              <span>{{ row.DeviceName }}</span>
            </template>
          </el-table-column>
          <el-table-column label="检测时间"    show-overflow-tooltip prop="TransTime" align="left"></el-table-column>
          <el-table-column label="网络业务"    show-overflow-tooltip prop="ServiceName" align="left"></el-table-column>
          <el-table-column label="检测结果"    show-overflow-tooltip prop="Status" align="left">
            <template slot-scope="{row}">
              <span :style="{color: row.Status === 1 ? '#67C23A' : '#F56C6C'}">{{row.Status === 1 ? '正常' : '异常'}}</span>
            </template>
          </el-table-column>
          <el-table-column label="检测描述" show-overflow-tooltip prop="Descp" align="left"></el-table-column>
          <el-table-column label="操作" align="left" width="120px" fixed="right">
            <template slot-scope="scope">
              <el-button size="mini" type="primary" @click="changeMailGlobalnet(scope.row)">最近日志</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination 
          @size-change="handleSizeChangeNet"
          @current-change="handleCurrentChangeNet" 
          :current-page=pageNum_net
          :page-size=pageSize_net
          background 
          layout="total, prev, pager, sizes, next, jumper"
          :total="total_net">
        </el-pagination>
        </el-tab-pane>
        <el-tab-pane label="软件使用">
          <div class="top">
                <el-button type="primary" style="float:right;margin-bottom: 10px;" @click="$router.go(-1)">返回</el-button>
          </div>
            <el-table stripe border :data="useSoftTable" style="width: 100%; margin-top: 15px;min-height:520px">
              <el-table-column label="序号"  width="60" type="index" :index='(index)=>{return (index + 1) + (this.useSoftpageNum - 1)*this.useSoftpageSize}'> </el-table-column>
              <!-- <el-table-column label="所在分区" show-overflow-tooltip prop="PrimArea" width="150" align="left">
                  <template slot-scope="{row}">
                    <span>{{ row.PrimArea }} / {{ row.SecondArea }}</span>
                  </template>
                </el-table-column>
              <el-table-column label="所在校区" show-overflow-tooltip prop="SchoolName" align="left"></el-table-column> -->
                <el-table-column label="资产名称" show-overflow-tooltip prop="DeviceName"  width="180" align="left"></el-table-column>
                <el-table-column label="统计日期" show-overflow-tooltip prop="TransDate" width="160px" align="left"></el-table-column>
                <el-table-column label="使用时长" show-overflow-tooltip prop="RunningSeconds" align="left"></el-table-column>
                <el-table-column label="软件分类" show-overflow-tooltip prop="ProcClass" align="left">
                  <template slot-scope="{row}">
                    <span>{{ row.ProcClass === '' ? '未分类' : row.ProcClass }}</span>
                  </template>
                </el-table-column>
              <el-table-column label="软件名称" show-overflow-tooltip prop="ProcName" align="left"></el-table-column>
              <el-table-column label="执行文件" show-overflow-tooltip prop="ProcExe" align="left"></el-table-column>
              <el-table-column label="窗口标题" show-overflow-tooltip prop="Title" align="left"></el-table-column>
              <el-table-column label="执行文件全路径" show-overflow-tooltip prop="FullPath" align="left"></el-table-column>
              <el-table-column label="签名厂商" show-overflow-tooltip prop="CertFactory" align="left"></el-table-column>
                <el-table-column label="操作" width="120px" align="left" fixed="right" >
                  <template slot-scope="scope"> 
                    <el-button :type="scope.row.ProcClass ==''|| scope.row.ProcClass =='未分类'?'primary':'info'" :disabled="scope.row.ProcClass !=''" size="mini" @click="changeModer_use(scope.row)">加入字典</el-button>
                  </template>
                </el-table-column>
            </el-table>
            <el-pagination  
              @size-change="handleSizeChangeuse"
              @current-change="handleCurrentChangeuse" 
              :current-page=useSoftpageNum
              :page-size=useSoftpageSize
              background 
              layout="total, prev, pager, sizes, next, jumper"
              :total="useSoftTotal">
            </el-pagination>
        </el-tab-pane>
        <el-tab-pane label="安装软件" lazy>
          <div class="top">
                <el-button type="primary" style="float:right;margin-bottom: 10px;" @click="$router.go(-1)">返回</el-button>
          </div>
          <el-table stripe border :data="installTable" style="width: 100%; margin-top: 15px;min-height:520px">
            <el-table-column label="序号"  width="60" type="index" :index='(index)=>{return (index + 1) + (this.pageNum_int - 1)*this.pageSize_int}'> </el-table-column>
            <!-- <el-table-column label="所在分区" prop="PrimArea" width="150" align="left" show-overflow-tooltip>
                <template slot-scope="{row}">
                  <span>{{ row.PrimArea }} / {{ row.SecondArea }}</span>
                </template>
              </el-table-column>
            <el-table-column label="所在校区" show-overflow-tooltip prop="SchoolName" align="left"></el-table-column> -->
            <el-table-column label="资产名称" show-overflow-tooltip prop="DeviceName" align="left"></el-table-column>
            <el-table-column label="采集时间" show-overflow-tooltip prop="TransTime" align="left"></el-table-column>
            <el-table-column label="软件分类" show-overflow-tooltip prop="AppClass" align="left">
              <template slot-scope="{row}">
                <span>{{ row.AppClass === '' ? '未分类' : row.AppClass }}</span>
              </template>
            </el-table-column>
            <el-table-column label="软件名称" show-overflow-tooltip prop="AppName" align="left"></el-table-column>
            <el-table-column label="操作系统" show-overflow-tooltip prop="OSClass" align="left"></el-table-column>
            <el-table-column label="发布厂商" show-overflow-tooltip prop="Descp" align="left"></el-table-column>
            <el-table-column label="版本号 "  show-overflow-tooltip prop="Version" align="left"></el-table-column>
            <el-table-column label="操作" width="120px" align="left" fixed="right" >
              <template slot-scope="scope"> 
                <el-button :type="scope.row.AppClass ==''|| scope.row.AppClass =='未分类'?'primary':'info'" :disabled="scope.row.AppClass !=''" size="mini" @click="changeModer_int(scope.row)">加入字典</el-button>
              </template>
            </el-table-column>
          </el-table>
          <el-pagination 
            @size-change="handleSizeChange_int"
            @current-change="handleCurrentChange_int" 
            :current-page=pageNum_int
            :page-size=pageSize_int
            background 
            layout="total, prev, pager, sizes, next, jumper"
            :total="Total_int">
          </el-pagination>
        </el-tab-pane>
        <el-tab-pane label="非法软件" lazy>
          <div class="top">
                <el-button type="primary" style="float:right;margin-bottom: 10px;" @click="$router.go(-1)">返回</el-button>
          </div>
          <el-table stripe border :data="illegalityTable" style="width: 100%; margin-top: 15px;min-height:520px">
              <el-table-column label="序号"  width="60" type="index" :index='(index)=>{return (index + 1) + (this.pageNum_ill - 1)*this.pageSize_ill}'> </el-table-column>
              <!-- <el-table-column label="所在分区" show-overflow-tooltip prop="PrimArea" width="150" align="left">
                  <template slot-scope="{row}">
                    <span>{{ row.PrimArea }} / {{ row.SecondArea }}</span>
                  </template>
                </el-table-column>
              <el-table-column label="所在校区" show-overflow-tooltip prop="SchoolName" align="left"></el-table-column> -->
              <el-table-column label="资产名称" show-overflow-tooltip prop="DeviceName" align="left"></el-table-column>
              <el-table-column label="采集时间" show-overflow-tooltip prop="TransTime" align="left"></el-table-column>
              <el-table-column label="软件分类" show-overflow-tooltip prop="AppClass" align="left">
                <template slot-scope="{row}">
                  <span>{{ row.AppClass === '' ? '未分类' : row.AppClass }}</span>
                </template>
              </el-table-column>
              <el-table-column label="软件名称" show-overflow-tooltip prop="AppName" align="left"></el-table-column>
              <el-table-column label="操作系统" show-overflow-tooltip prop="OSClass" align="left"></el-table-column>
              <el-table-column label="发布厂商" show-overflow-tooltip prop="Descp" align="left"></el-table-column>
              <el-table-column label="版本号 "  show-overflow-tooltip prop="Version" align="left"></el-table-column>
              <!-- <el-table-column label="操作" width="120px" align="left" fixed="right" >
                <template slot-scope="scope">
                  <el-button type="primary" size="mini" @click="changeModer_int(scope.row)">加入字典</el-button>
                </template>
              </el-table-column> -->
            </el-table>
            <el-pagination 
              @size-change="handleSizeChange_ill"
              @current-change="handleCurrentChange_ill" 
              :current-page=pageNum_ill
              :page-size=pageSize_ill
              background 
              layout="total, prev, pager, sizes, next, jumper"
              :total="Total_ill">
            </el-pagination>
        </el-tab-pane>
        <el-tab-pane label="缺失软件" lazy>
          <div class="top">
                <el-button type="primary" style="float:right;margin-bottom: 10px;" @click="$router.go(-1)">返回</el-button>
          </div>
          <el-table stripe border :data="deficiencyTable" style="width: 100%; margin-top: 15px;min-height:520px">
            <el-table-column label="序号"  width="60" type="index" :index='(index)=>{return (index + 1) + (this.pageNum_def - 1)*this.pageSize_def}'> </el-table-column>
            <!-- <el-table-column label="所在分区" show-overflow-tooltip prop="PrimArea" width="150" align="left">
                <template slot-scope="{row}">
                  <span>{{ row.PrimArea }} / {{ row.SecondArea }}</span>
                </template>
              </el-table-column>
            <el-table-column label="所在校区" show-overflow-tooltip prop="SchoolName" align="left"></el-table-column> -->
            <el-table-column label="资产名称" show-overflow-tooltip prop="DeviceName" align="left"></el-table-column>
            <!-- <el-table-column label="采集时间" show-overflow-tooltip prop="TransTime" align="left"></el-table-column> -->
            <el-table-column label="软件分类" show-overflow-tooltip prop="AppClass" align="left">
              <template slot-scope="{row}">
                <span>{{ row.AppClass === '' ? '未分类' : row.AppClass }}</span>
              </template>
            </el-table-column>
            <el-table-column label="软件名称" show-overflow-tooltip prop="AppName" align="left"></el-table-column>
            <el-table-column label="操作系统" show-overflow-tooltip prop="OSClass" align="left"></el-table-column>
            <!-- <el-table-column label="发布厂商" show-overflow-tooltip prop="Descp" align="left"></el-table-column> -->
            <el-table-column label="版本号 "  show-overflow-tooltip prop="Version" align="left"></el-table-column>
            <!-- <el-table-column label="操作" width="120px" align="left" fixed="right" >
              <template slot-scope="scope">
                <el-button type="primary" size="mini" @click="changeModer_int(scope.row)">加入字典</el-button>
              </template>
            </el-table-column> -->
          </el-table>
          <el-pagination 
            @size-change="handleSizeChange_def"
            @current-change="handleCurrentChange_def" 
            :current-page=pageNum_def
            :page-size=pageSize_def
            background 
            layout="total, prev, pager, sizes, next, jumper"
            :total="Total_def">
          </el-pagination>
        </el-tab-pane>
        <el-tab-pane label="状态变更">
          <div class="top"> 
                <el-button type="primary" style="float:right;margin-bottom: 10px;" @click="$router.go(-1)">返回</el-button>
          </div>
          <el-table stripe border :data="devieceStaTable" style="width: 100%; margin-top: 15px;min-height:520px">
          <el-table-column label="序号"  width="60" type="index" :index='(index)=>{return (index + 1) + (this.pageNum_dev - 1)*this.pageSize_dev}'> </el-table-column>
          <!-- <el-table-column label="所在分区" prop="PrimArea" width="150" align="left" show-overflow-tooltip>
              <template slot-scope="{row}">
                <span>{{ row.PrimArea }} / {{ row.SecondArea }}</span>
              </template>
            </el-table-column>
          <el-table-column label="所在校区" prop="SchoolName" align="left"></el-table-column> -->
          <el-table-column label="资产名称" prop="DeviceName" width="180" align="left" show-overflow-tooltip></el-table-column>
          <el-table-column label="发生时间" prop="TransTime" width="160" align="left"></el-table-column>
          <el-table-column label="状态变化" prop="Status" width="140" align="left">
            <template slot-scope="{row}">
              <span style="color:#909399" v-show="row.Status == 2">下线</span>
              <span style="color:#67C23A" v-show="row.Status == 1">上线</span>
            </template>
          </el-table-column>
          <el-table-column label="变更原因" prop="Reason" align="left"></el-table-column>
        </el-table>
        <el-pagination 
          @size-change="handleSizeChange_dev"
          @current-change="handleCurrentChange_dev" 
          :current-page=pageNum_dev
          :page-size=pageSize_dev
          background 
          layout="total, prev, pager, sizes, next, jumper"
          :total="Total_dev">
        </el-pagination>
        </el-tab-pane>
        <el-tab-pane label="基线核查">
          <div class="top">
                <el-button type="primary" style="float:right;margin-bottom: 10px;" @click="$router.go(-1)">返回</el-button>
          </div>
          <el-table stripe border :data="BaseLineForm" style="width: 100%; margin-top: 15px;min-height:520px">
          <el-table-column label="序号"  width="60" type="index" :index='(index)=>{return (index + 1) + (this.pageNum_event - 1)*this.pageSize_event}'> </el-table-column>
          <!-- <el-table-column label="所在分区" prop="PrimArea" width="120" align="left" show-overflow-tooltip>
              <template slot-scope="{row}">
                <span>{{ row.PrimArea }} / {{ row.SecondArea }}</span>
              </template>
            </el-table-column>
            <el-table-column label="所在校区" show-overflow-tooltip prop="SchoolName" width="140" align="left">
            <template slot-scope="{row}">
              <span>{{ row.SchoolName }}</span>
            </template>
          </el-table-column> -->
          <el-table-column label="资产名称" show-overflow-tooltip prop="DeviceName" width="180"  align="left">
            <template slot-scope="{row}">
              <span>{{ row.DeviceName }}</span>
            </template>
          </el-table-column>
          <el-table-column label="检测时间" show-overflow-tooltip prop="TransTime" width="160" align="left"></el-table-column>
          <el-table-column label="核查项目" show-overflow-tooltip prop="BlID" align="left">
            <template slot-scope="{row}">
              <span>{{ findBaselineLabel(row.BlID) }}</span>
            </template>
          </el-table-column>
          <el-table-column label="合规结论" show-overflow-tooltip prop="NeedFix" width="120" align="left">
            <template slot-scope="{row}">
              <span :style="{color: row.NeedFix === 0 ? '#67C23A' : '#F56C6C'}">{{row.NeedFix === 0 ? '合规' : '不合规'}}</span>
            </template>
          </el-table-column>
          <el-table-column label="描述信息" show-overflow-tooltip prop="Descp" align="left"></el-table-column>
          <el-table-column label="操作" align="left" width="120px" fixed="right">
            <template slot-scope="scope">
              <el-button size="mini" type="primary" @click="changeMailGlobalBase(scope.row)">详情</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination 
          @size-change="handleSizeChange_event"
          @current-change="handleCurrentChange_event" 
          :current-page=pageNum_event
          :page-size=pageSize_event
          background 
          layout="total, prev, pager, sizes, next, jumper"
          :total="Total_event">
        </el-pagination>
        </el-tab-pane>
    </el-tabs>
    <el-dialog
      top="5vh"
      :close-on-click-modal="false"
      :close-on-press-escape=false
      title="最近日志"
      :visible.sync="logDialognet"
      v-el-drag-dialog
      width="80%">
      <el-table stripe border :data="logList" style="width: 100%;" height="490px">
        <el-table-column label="序号"  width="60" type="index" :index='(index)=>{return (index + 1) + (this.pageNum2 - 1)*this.pageSize2}'> </el-table-column>
        <el-table-column label="资产名称" prop="DeviceName" width="180" align="left" show-overflow-tooltip></el-table-column>
        <el-table-column label="检测时间" prop="TransTime" show-overflow-tooltip width="160" align="left"></el-table-column>
        <el-table-column label="网络业务" prop="ServiceName" show-overflow-tooltip width="240" align="left"></el-table-column>
        <el-table-column label="检测结果" prop="Status" show-overflow-tooltip width="120" align="left">
          <template slot-scope="{row}">
            <span :style="{color: row.Status === 1 ? '#67C23A' : '#F56C6C'}">{{row.Status === 1 ? '正常' : '异常'}}</span>
          </template>
        </el-table-column>
        <el-table-column label="检测描述" prop="Descp" align="left" show-overflow-tooltip></el-table-column>
      </el-table>
      <el-pagination 
        @size-change="handleSizeChange2"
        @current-change="handleCurrentChange2" 
        :current-page=pageNum2
        :page-size=pageSize2
        background 
        layout="total, prev, pager, sizes, next, jumper"
        :total="total2">
      </el-pagination>
    <span slot="footer" class="dialog-footer">
      <el-button type="info" @click="logDialognet = false">关 闭</el-button>
    </span>
    </el-dialog>
    <el-dialog 
      :close-on-click-modal="false" 
      :close-on-press-escape="false" 
      :visible.sync="moderVisible"
      title="加入字典" 
      v-el-drag-dialog @close="ModerDict = {}" width="30%">
      <el-form label-width="100px" :rules="rules" :model="ModerDict" ref="ModerDict">
        <el-form-item label="软件名称" prop="AppName">
          <el-input placeholder="请输入软件名称" maxlength="16" v-model="ModerDict.AppName"></el-input>
        </el-form-item>
        <el-form-item label="软件分类" prop="Class">
          <el-select v-model="ModerDict.Class" placeholder="请选择软件分类" style="width:100%">
            <el-option  v-for="(item, index) in partitionList_soft" :key="index" :label="item.label" :value="item.value"></el-option>
          </el-select>
        </el-form-item>
        <!-- <el-form-item label="软件安装名" prop="ExeName">
          <el-input placeholder="请输入软件安装名" oninput="value=value.replace(/[^0-9a-zA-Z.]/g,'')" maxlength="32" v-model="ModerDict.ExeName"></el-input>
        </el-form-item> -->
        <el-form-item label="软件版本" prop="Version">
          <el-input placeholder="请输入软件版本" maxlength="32" v-model="ModerDict.Version"></el-input>
        </el-form-item>
        <el-form-item label="操作系统" prop="OSClass">
          <el-select v-model="ModerDict.OSClass" style="width:100%" placeholder="请选择适用系统">
            <el-option  label="Windows" value="Windows"></el-option>
            <el-option  label="Mac" value="Mac"></el-option>
            <el-option  label="Android" value="Android"></el-option>
            <el-option  label="Linux" value="Linux"></el-option>
            <el-option  label="Other" value="Other"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="系统类型" prop="OSType">
          <el-select v-model="ModerDict.OSType" style="width:100%" placeholder="请选择系统类型">
            <el-option label="全部" value=""></el-option>
            <el-option label="64" value="64"></el-option>
            <el-option label="32" value="32"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="软件类型" prop="Property">
          <el-select v-model="ModerDict.Property" style="width:100%" placeholder="请选择软件类型">
            <el-option label="必装软件" :value="1"></el-option> 
            <el-option label="非法软件" :value="2"></el-option>
            <el-option label="选装软件" :value="3"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submit_soft()">确 定</el-button>
        <el-button type="info" @click="moderVisible = false">取 消</el-button>
      </span>
    </el-dialog>
    <el-dialog
      :close-on-click-modal="false"
      :close-on-press-escape=false
      title="详情"
      :visible.sync="BashLineShow"
      v-el-drag-dialog
      width="1000px"> 
        <el-descriptions class="margin-top" :column="2"  border>
          <!-- <el-descriptions-item label="所在分区">{{ BaseLineinfo.PrimArea }}/{{ BaseLineinfo.SecondArea }}</el-descriptions-item> -->
          <!-- <el-descriptions-item label="校区名称">{{ BaseLineinfo.SchoolName }}</el-descriptions-item> -->
          <!-- <el-descriptions-item label="校区唯一编码">{{ BaseLineinfo.SchoolID }}</el-descriptions-item> -->
          <el-descriptions-item label="资产名称">{{ BaseLineinfo.DeviceName }}</el-descriptions-item>
          <el-descriptions-item label="资产唯一编码">{{ BaseLineinfo.DeviceID }}</el-descriptions-item>
          <el-descriptions-item label="从属部门">{{ BaseLineinfo.Department }}</el-descriptions-item>
          <el-descriptions-item label="检测时间">{{ BaseLineinfo.TransTime }}</el-descriptions-item>
          <el-descriptions-item label="核查项目"> 
                <span>{{ findBaselineLabel(BaseLineinfo.BlID) }}</span>
          </el-descriptions-item>
          <el-descriptions-item label="合规结论"> 
                <span :style="{color: BaseLineinfo.NeedFix === 0 ? '#67C23A' : '#F56C6C'}">{{BaseLineinfo.NeedFix === 0 ? '合规' : '不合规'}}</span>
          </el-descriptions-item>
          <el-descriptions-item label="描述信息" :span="2">{{ BaseLineinfo.Descp }}</el-descriptions-item>
          <el-descriptions-item label="修复建议" :span="2">{{ findBaselineFixScheme(BaseLineinfo.BlID) }}</el-descriptions-item>
        </el-descriptions>
        <span slot="footer" class="dialog-footer">
          <el-button type="info" @click="BashLineShow = false">关 闭</el-button>
      </span>
    </el-dialog>
    <el-dialog 
      :close-on-click-modal="false" 
      :close-on-press-escape="false" 
      :visible.sync="UsemoderVisible"
      title="加入字典" 
      v-el-drag-dialog @close="ModerDict = {},$refs['ModerDict_use'].resetFields();" width="30%">
      <el-form label-width="100px" :rules="rules2" :model="ModerDict" ref="ModerDict_use">
        <el-form-item label="执行文件" prop="ProcExe">
          <el-input placeholder="请输入执行文件"  disabled  v-model="ModerDict.ProcExe"></el-input>
        </el-form-item>
        <el-form-item label="进程分类" prop="ProcClass">
          <el-select v-model="ModerDict.ProcClass" placeholder="请选择进程分类" style="width:100%">
            <el-option  v-for="(item,index) in partitionList_use" :key="index" :label="item.label" :value="item.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="进程名称" prop="ProcName">
          <el-input placeholder="请输入进程名称" maxlength="16"  v-model.trim="ModerDict.ProcName"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submit_use()">确 定</el-button>
        <el-button type="info" @click="UsemoderVisible = false,$refs['ModerDict_use'].resetFields();">取 消</el-button>
        </span>
    </el-dialog>
  </div>
</template>

<script>
import assetsInfo from "@/components/assetsInfo"
import HardDetail from "@/components/HardDetail"
import linechart from "./components/linechart.vue"
import elDragDialog from "@/directive/el-drag-dialog"; 
import { connrequest } from '@/api/firstPage'
import { parseTime, getuuid, recursiveGetNodePath, recursiveGetChildNodePath,formatDuration,getNowDay,bytesToSize ,formatTime2,formatBytes_back} from '@/utils/index'
export default {
  directives: { elDragDialog},
  components: {
    assetsInfo,linechart,HardDetail
  },
  data() {
    let that = this
    return {
      control:false,
      ModerDict:{},
      Moder: {},
      partitionList: [],
      partitionList_use: [],
      partitionList_soft: [],
      activeTab:'tab1',
      UsemoderVisible:false,
      moderVisible:false,
      deviceForm:{},
      rules: [], // elementui组件属性
      installTable:[],
      pageNum_int: 1,
      pageSize_int: 10,
      Total_int:0,
      illegalityTable:[],
      pageNum_ill: 1,
      pageSize_ill: 10,
      Total_ill:0,
      deficiencyTable:[],
      pageNum_def: 1,
      pageSize_def: 10,
      Total_def:0,
      devieceStaTable:[],
      pageNum_dev: 1,
      pageSize_dev: 10,
      Total_dev:0,
      EventTable:[],
      pageNum_event: 1,
      pageSize_event: 10,
      Total_event:0,
      netForm:[],
      eventTable:[],
      EventpageNum: 1,
      EventpageSize: 10,
      EventTotal:0,
      useSoftTable:[],
      useSoftpageNum: 1,
      useSoftpageSize: 10,
      useSoftTotal:0,
      BaseLineForm:[],
      BaseLineinfo:[],
      BashLineShow:false,
      BaselineResultList: [],
      total: 0,
      eventList: [],
      lineData_cpu:{
        time:[],downByte:[],info:''
      },
      lineData_soft:{
        time:[],downByte:[],info:''
      },
      SystemData:[],
      logDialognet: false,
      logList: [],
      pageNum: 1,
      pageSize: 10,
      pageNum_net: 1,
      pageSize_net: 10,
      total_net:0,
      pageNum2: 1,
      pageSize2: 10,
      total2: 0,
      pageNum_app: 1,
      pageSize_app: 10,
      Device_pageNum: 1,
      Device_pageSize: 10,
      total: 0,
      formOptions: [
        {
          col: 4,
          hidden: false,
          label: "在线状态", // label文字
          prop: "Status", // 字段名
          element: "el-select", // 指定elementui组件
          initValue: 0, // 字段初始值,
          placeholder: "请选择在线状态", // elementui组件属性
          options: [
            { label: '全部', value: 0 },
            { label: '在线', value: 1 },
            { label: '离线', value: 2 }
          ],
          rules: [], // elementui组件属性
          events: {
            input(val) {
              that.searchform.Status = val
            }
          }
        },
        {
          col: 8,
          label: "分区校区选择",
          prop:"SchoolName",
          element: "el-cascader",
          initValue: "",
          placeholder: "请选择校区",
          options:[],
          props:{emitPath: true, checkStrictly: true, lazy: true, lazyLoad: that.lazyLoad},
          events: {
            input(val) {
              // console.log(val);
              that.searchform.SchoolName = val
            }
          }
        },
        {
          col: 4,
          hidden: false,
          label: "排序字段", // label文字
          prop: "Sort_value", // 字段名
          element: "el-select", // 指定elementui组件
          initValue: "SchoolName", // 字段初始值,
          placeholder: "请选择排序字段", // elementui组件属性
          options: [
            { label: '校区名称', value: 'SchoolName' },
            { label: '在线状态', value: 'Status' },
            { label: '运行时长', value: 'KeepRunningTime' }
          ],
          events: {
            input(val) {
              that.searchform.Sort_value = val
            }
          }
        }
       
      ],
      rules:{
        SchoolID: [
          {required: true, message: '请选择校区编码', trigger: 'blur'}
        ],
        SchoolName: [
          {required: true, message: '请选择校区名称', trigger: 'blur'}
        ],
        PrimArea: [
          {required: true, message: '请选择上级分区', trigger: 'change'}
        ],
        SecondArea: [
          {required: true, message: '请输入分区名称', trigger: 'blur'}
        ],
        AreaCode: [
          {required: true, message: '请输入分区编码', trigger: 'blur'}
        ],
        ClassName: [
          {required: true, message: '请输入教室', trigger: 'blur'}
        ],
        Phone: [
          {required: true, message: '请输入联系电话', trigger: 'blur'},
          {
            validator: function(rule, value, callback) {
              if (/^1[34578]\d{9}$/.test(value) == false && value) {
                callback(new Error("手机号格式错误"));
              } else {
                callback();
              }
            },
            trigger: "blur"
          }
        ],
        DeviceClass: [
          {required: true, message: '请选择操作系统', trigger: 'change'}
        ],
        DeviceType: [
          {required: true, message: '请选择资产类型', trigger: 'change'}
        ]
      },
      rules2:{
        ProcExe: [
          {required: true, message: '请输入执行文件', trigger: 'blur'}
        ],
        ProcClass: [
          {required: true, message: '请选择进程分类', trigger: 'blur'}
        ],
        ProcName: [
          {required: true, message: '请输入进程名称', trigger: 'blur'}
        ]
      },
      netInfo:{},
    }
  },
  mounted(){
    this.Moder = JSON.parse(sessionStorage.getItem('detailStatus'))
    // this.Moder = this.$route.query.Moder
    // console.log(this.$route.query);
    this.GetParamDictEvent()
    this.getSystemData()
    this.GetDictSoftwareTree()
    this.GetDictUseSoftTree()
  },
  methods:{
    async getSystemData(){
      const res = await connrequest('GetParamThreshhold')
      res.Data = res.Data || []
      res.Data.map( item  => {
        this.SystemData[item.Name] = item.Value
      })
      this.SystemData.cach_log_save_seconds = this.SystemData.cach_log_save_seconds / 3600 || 0
    },
    handleTabClick(tab) {
      const methodName = this.getMethodNameByTabIndex(tab.index);
      const method = this[methodName];
      if (method) {
        method(this.Moder);
      }
    },
    // 根据 tab.index 获取方法名
    getMethodNameByTabIndex(tabIndex) {
      const methodNames = [
        'getDeviceData',
        'getEvent',
        'changeModer',
        'changeModer_soft',
        'getNetData',
        'getuseSoft',
        'getinstallData',
        'getillegalityData',
        'getdeficiencyData',
        'getDeviceStatus',
        'getBaseLineData'
      ];

      return methodNames[tabIndex - 1] || ''; // 注意减去1以匹配数组索引
    },
    async changeMailGlobalBase(row){
      this.BaseLineinfo = {...row}
      this.BashLineShow = true
    },
    // 获取事件定义
    async GetParamDictEvent(){
      const res = await connrequest('GetParamDictEvent')
      let arr = []
      res.Data.map(item => {
        arr.push({label: item.AlarmDescp, value: item.EventID})
      })
      this.formOptions.map( item => {
        if(item.label === '事件类型'){
          item.options = arr
          item.initValue = arr[0]?.value
        }
      })
      this.eventList = arr
    },
    getEventLabel(eventID) {
      return this.eventList.find(item => item.value === eventID)?.label || null;
    },
    async changeMailGlobalnet(row){
    this.netInfo = {...row} 
    // console.log(row);
      const data = { 
        Paging:{
          QueryPageNo: this.pageNum2,
          QueryPageLength: this.pageSize2
        },
        Filter:{
          DeviceID: row.DeviceID,
          NetworkServiceName: row.ServiceName
        }
      }
      const res = await connrequest('GetDeviceHistoryNetworkService', data)
      res.Data = res.Data.map(item => {
        item.TransTime = formatTime2(item.TransTime)
        return item
      })
      this.logList = res.Data
      this.total2 = res.Paging?.TotalCount
      this.logDialognet = true
    },
    async submit_use(){
      this.$refs['ModerDict_use'].validate(async (valid) => {
        if (valid) {
          const data = {
            Data: {
              Action: 1,
              Detail: {
                ExeName:this.ModerDict.ProcExe,
                Class:this.ModerDict.ProcClass,
                Name:this.ModerDict.ProcName
              }
            }
          }
          const res = await connrequest('EditDictProc', data)
          if(res.Status.StatusCode === 0){
            this.$message.success('加入字典成功')
            // this.getuseSoft(this.Moder)
            this.UsemoderVisible = false
          }
        }
      })
    },
    async submit_soft(){
      const data = {
        Data: {
          Action: 1,
          Detail: {
            Descp: this.ModerDict.AppName,
            Factory: this.ModerDict.Descp,
            Class: this.ModerDict.Class,
            Version: this.ModerDict.Version,
            OSClass: this.ModerDict.OSClass,
            OSType: this.ModerDict.OSType,
            Property: this.ModerDict.Property,
          }
        } 
      }
      const res = await connrequest('EditDictInstallApp', data)
      if(res.Status.StatusCode === 0){
        this.$message.success('加入字典成功')
        // this.getinstallData(this.Moder)
        this.moderVisible = false
      }
    },
    async GetBaselineFixSet(){
      const res = await connrequest('GetBaselineFixSet')
      let arr = []
      res.Data.BaselineResult.map(item => {
        arr.push({ label: item.Subject, value: item.id * 1, FixScheme: item.FixScheme })
      })
      this.formOptions.map( item => {
        if(item.label === '检测项目'){
          item.options = [{label: '全部', value: '', FixScheme: ''}, ...arr]
        }
      })
      this.BaselineResultList = arr
    },
    findBaselineLabel(BlID) {
      const baselineItem = this.BaselineResultList.find(item => item.value === BlID);
      return baselineItem ? baselineItem.label : '';
    },
     findBaselineFixScheme(BlID) {
      const baselineItem = this.BaselineResultList.find(item => item.value === BlID);
      return baselineItem ? baselineItem.FixScheme : '';
    },
    async changeMailGlobalAll(row){
      const arr = this.eventTable.map(item => item.AutoID);
      const data = {
        Data: arr
      } 
      const res = await connrequest('ConfirmEvent', data)
      if (res.Status.StatusCode === 0) {
        this.$message.success('确认成功')
        this.getEvent(this.Moder)
      }
    },
    async changeMailGlobal(row){ 
      const data = { 
        Data: [row.AutoID]
      }
      const res = await connrequest('ConfirmEvent', data)
      if (res.Status.StatusCode === 0) {
        this.$message.success('确认成功')
        this.getEvent(this.Moder)
      }
    },
    async getuseSoft(row){
      const data = {
        Paging: {
          QueryPageNo: this.useSoftpageNum,
          QueryPageLength: this.useSoftpageSize
        },
        Filter: {
          PrimArea:   row.PrimArea,
          SecondArea: row.SecondArea,
          // SchoolName: row.SchoolName,
          DeviceID: row.DeviceID
        }
      }
      const res = await connrequest('GetWindowProc', data)
      res.Data = res.Data || []
      res.Data = res.Data.map(item => {
        item.RunningSeconds = formatDuration(item.RunningSeconds) 
        return item
      })
      this.useSoftTable = res.Data
      this.useSoftTotal = res.Paging?.TotalCount || 0
    },
    async GetDictSoftwareTree(){
      const res = await connrequest('GetDictInstallAppTree')
      let arr = [{label: '全部', value: ''}]
      res.Data.Class.map(item => {
        arr.push( {label: item.Name, value: item.Name} )
      })
      this.formOptions.map( item => {
        if(item.label === '软件分类'){
          item.options = arr
        }
      })
      this.partitionList_soft = arr.filter(item => item.label !== '全部')
    },
    async GetDictUseSoftTree(){
      const res = await connrequest('GetDictProcTree')
      // console.log(res);
      let arr = []
      res.Data.Class.map(item => {
        arr.push( {label: item.Name, value: item.Name} )
      })
      this.partitionList_use = arr
      // console.log(this.partitionList_use);
    },
    changeModer_use(row){
      this.ModerDict = {ProcExe:row.ProcExe,ProcName:row.ProcName,ProcClass:row.ProcClass}
      this.UsemoderVisible = true
    },
    changeModer_int(row){
      this.ModerDict = {...row, Property: row.Property || 3,Class:this.partitionList_soft[0]?.value || ''}
      this.moderVisible = true;
    },
    async changeModer(row){
      const data = {
        Filter:{
          StartTime: parseTime(new Date().getTime()-this.SystemData.cach_log_save_seconds  * 60 * 60 * 1000),
          EndTime: parseTime(new Date().getTime()),
          DeviceID: row.DeviceID,
          PerfType: 1
        }
      }
      const res = await connrequest('GetDeviceHistoryPerfStatus', data)
      let downByte = []
      let time = []
      res.Data.map(item => {
        downByte.push(item.Percent)
        time.push(parseTime(item.TransTime, '{h}:{i}:{s}'))
      })
      var info = '近' + this.SystemData.cach_log_save_seconds +'小时CPU使用率'
      
      this.lineData_cpu = {time, downByte,info:info}
    },
    async changeModer_soft(row){
      const data = {
        Filter:{
          StartTime: parseTime(new Date().getTime()-this.SystemData.cach_log_save_seconds  * 60 * 60 * 1000),
          EndTime: parseTime(new Date().getTime()),
          DeviceID: row.DeviceID,
          PerfType: 2
        }
      }
      const res = await connrequest('GetDeviceHistoryPerfStatus', data)
      let downByte = []
      let time = []
      res.Data.map(item => {
        downByte.push(item.Percent)
        time.push(parseTime(item.TransTime, '{h}:{i}:{s}'))
      })
      var info = '近' + this.SystemData.cach_log_save_seconds +'小时内存使用率'
      this.lineData_soft = {time, downByte,info:info}
    },
    async getEvent(row){
      const data = {
        Paging: {
          QueryPageNo: this.EventpageNum,
          QueryPageLength: this.EventpageSize
        },
        Filter: { 
          "StartTime": getNowDay('time'),
          "EndTime": getNowDay('23:59:59'),
          "PrimArea": row.PrimArea,
          "SecondArea": row.SecondArea,
          "SchoolName": row.SchoolName,
          "DeviceID": row.DeviceID
        }
      }
      const res = await connrequest('GetEventLog', data)
      res.Data = res.Data || []
      this.control = false
      res.Data = res.Data.map(item => {
        item.TransTime = parseTime(item.TransTime)
        if (item.IsACK === 0) {
          this.control = true
        }
        return item
      })
      this.eventTable = res.Data
      this.EventTotal = res.Paging.TotalCount
    },
    handleSizeChangeNet(pageSize){
      this.pageSize_net = pageSize
      this.pageNum_net = 1
      this.getNetData(this.Moder)
    },
    handleCurrentChangeNet( pageNum ){
      this.pageNum_net = pageNum
      this.getNetData(this.Moder)
    },
    handleSizeChange2(pageSize){
      this.pageSize2 = pageSize
      this.pageNum2 = 1
      this.changeMailGlobalnet(this.netInfo)
    },
    handleCurrentChange2( pageNum ){
      this.pageNum2 = pageNum
      this.changeMailGlobalnet(this.netInfo)
    },
    handleSizeChangeuse(pageSize){
      this.useSoftpageSize = pageSize
      this.useSoftpageNum = 1
      this.getuseSoft(this.Moder)
    },
    handleCurrentChangeuse( pageNum ){
      this.useSoftpageNum = pageNum
      this.getuseSoft(this.Moder)
    },
    handleSizeChange_int(pageSize){
      this.pageSize_int = pageSize
      this.pageNum_int = 1
      this.getinstallData(this.Moder)
    },
    handleCurrentChange_int( pageNum ){
      this.pageNum_int = pageNum
      this.getinstallData(this.Moder)
    },
    handleSizeChange_ill(pageSize){
      this.pageSize_ill = pageSize
      this.pageNum_ill = 1
      this.getillegalityData(this.Moder)
    },
    handleCurrentChange_ill( pageNum ){
      this.pageNum_ill = pageNum
      this.getillegalityData(this.Moder)
    },
    handleSizeChange_def(pageSize){
      this.pageSize_def = pageSize
      this.pageNum_def = 1
      this.getdeficiencyData(this.Moder)
    },
    handleCurrentChange_def( pageNum ){
      this.pageNum_def = pageNum
      this.getdeficiencyData(this.Moder)
    },
    handleSizeChange_dev(pageSize){
      this.pageSize_dev = pageSize
      this.pageNum_dev = 1
      this.getDeviceStatus(this.Moder)
    },
    handleCurrentChange_dev( pageNum ){
      this.pageNum_dev = pageNum
      this.getDeviceStatus(this.Moder)
    },
    handleSizeChange_event(pageSize){
      this.pageSize_event = pageSize
      this.pageNum_event = 1
      this.getBaseLineData(this.Moder)
    },
    handleCurrentChange_event( pageNum ){
      this.pageNum_event = pageNum
      this.getBaseLineData(this.Moder)
    },
    handleSizeChangeEvent(pageSize){
      this.EventpageSize = pageSize
      this.EventpageNum = 1
      this.getEvent(this.Moder)
    },
    handleCurrentChangeEvent( pageNum ){
      this.EventpageNum = pageNum
      this.getEvent(this.Moder)
    },
    async getDeviceData(row){
      const data = {
          Paging:{
            "QueryPageNo": 1,
            "QueryPageLength": 10
          },
          Filter:{
              "PrimArea": row.PrimArea,
              "SecondArea": row.SecondArea,
              "SchoolName": row.SchoolName,
              // "DeviceName": row.DeviceName,
              "DeviceID": row.DeviceID
          }
        }
        const res = await connrequest('GetDeviceHardware', data)
        // console.log("硬件",res);
        this.deviceForm = res.Data[0] || {}
        this.deviceForm.ExtDiskSize = parseInt(this.deviceForm.ExtDiskSize / 1000) + 'G'
        this.deviceForm.MemSize = bytesToSize(this.deviceForm.MemSize) 
        if(this.deviceForm.TransTime != undefined) 
          this.deviceForm.TransTime = formatTime2(this.deviceForm.TransTime)
        this.deviceForm.SysDiskSize = parseInt(this.deviceForm.SysDiskSize / 1000) + 'G'
    },
    async getinstallData(row){
      const data = {
          Paging:{
            "QueryPageNo": this.pageNum_int,
            "QueryPageLength": this.pageSize_int
          },
          Filter:{
              "PrimArea": row.PrimArea,
              "SecondArea": row.SecondArea,
              "SchoolName": row.SchoolName,
              "DeviceID": row.DeviceID,
              "InstallAppType":1
          }
        }   
        const res = await connrequest('GetInstallApp', data)
        const currentTimeStamp = new Date().getTime();
        res.Data = res.Data.map(item => {
          // 安装软件采集时间
          item.TransTime = formatTime2(item.TransTime)
          return item
        })
        //  console.log("安装软件",data,res);
        this.installTable = res.Data
        this.Total_int = res.Paging.TotalCount
    },
    async getillegalityData(row){
      const data = {
          Paging:{
            "QueryPageNo": this.pageNum_ill,
            "QueryPageLength": this.pageSize_ill
          },
          Filter:{
              "PrimArea": row.PrimArea,
              "SecondArea": row.SecondArea,
              "SchoolName": row.SchoolName,
              "DeviceID": row.DeviceID,
              "InstallAppType":2
          }
        }   
        const res = await connrequest('GetInstallApp', data)
        const currentTimeStamp = new Date().getTime();
        res.Data = res.Data.map(item => {
          // 非法软件采集时间
          item.TransTime = formatTime2(item.TransTime)
          return item
        })
        //  console.log("非法软件",data,res);
        this.illegalityTable = res.Data
        this.Total_ill = res.Paging.TotalCount
    },
    async getdeficiencyData(row){
      const data = {
          Paging:{
            "QueryPageNo": this.pageNum_def,
            "QueryPageLength": this.pageSize_def
          },
          Filter:{
               "PrimArea": row.PrimArea,
               "SecondArea": row.SecondArea,
               "SchoolName": row.SchoolName,
               "DeviceID": row.DeviceID,
              "InstallAppType":3
          }
        }   
        //  console.log("缺失软件",data,res);
        //  return
        const res = await connrequest('GetInstallApp', data)
        const currentTimeStamp = new Date().getTime();
        res.Data = res.Data.map(item => {
          // 必装软件采集时间
          item.TransTime = formatTime2(item.TransTime)
          return item
        })
        
        this.deficiencyTable = res.Data
        this.Total_def = res.Paging.TotalCount
    },
    async getNetData(row){
      const data = {
          Paging:{
            "QueryPageNo": this.pageNum_net,
            "QueryPageLength": this.pageSize_net
          },
          Filter:{
              PrimArea: row.PrimArea,
              SecondArea: row.SecondArea,
              SchoolName: row.SchoolName,
              DeviceID: row.DeviceID
          }
        }
        const res = await connrequest('GetDeviceRealNetworkService', data)
        const currentTimeStamp = new Date().getTime();
        res.Data = res.Data.map(item => {
          // 网络业务检测时间
          item.TransTime = formatTime2(item.TransTime)
          return item
      })
        this.netForm = res.Data
        this.total_net = res.Paging.TotalCount
    
    },
    async getDeviceStatus(row){
      const data = {
          Paging:{
            "QueryPageNo": this.pageNum_dev,
            "QueryPageLength": this.pageSize_dev
          },
          Filter:{
              PrimArea: row.PrimArea,
              SecondArea: row.SecondArea,
              SchoolName: row.SchoolName,
              DeviceID: row.DeviceID
              // DeviceID: row.DeviceID,
              // Status: row.Status,
          }
        }
        const res = await connrequest('GetDeviceStatusChangeLog', data)
        res.Data = res.Data.map(item => {
          // 状态变更发生时间
          item.TransTime = formatTime2(item.TransTime)
          return item
      })
        this.devieceStaTable = res.Data
        this.Total_dev = res.Paging.TotalCount
    },
    async getBaseLineData(row){
      this.GetBaselineFixSet()
      const data = {
         Paging: {
          QueryPageNo: this.pageNum_event,
            QueryPageLength: this.pageSize_event
          },
          Filter: {
            PrimArea: row.PrimArea || '',
            SecondArea: row.SecondArea || '',
            SchoolName: row.SchoolName || '',
            DeviceID: row.DeviceID || '',
            // BlID: row.BlID * 1,
            BaselineNeedFix: 0,
          }
        }
        const res = await connrequest('GetDeviceRealBaselineCheck', data)
        // console.log("基线核查",res,row);
        res.Data = res.Data || []
        const currentTimeStamp = new Date().getTime();
        res.Data = res.Data.map(item => {
          // 基线核查检测时间
          item.TransTime = formatTime2(item.TransTime)
          return item
        })
        this.BaseLineForm = res.Data 
        this.Total_event = res.Paging?.TotalCount
    },
  }
  
}
</script>

<style> 

.el-descriptions-item__label.is-bordered-label{
  width: 200px;
}
</style>